#ifndef WORM_H
#define WORM_H

class worm
{
public:

    typedef enum
    {
        VEGETARIAN, CANNIBAL, SCISSORHEAD
    } WORM_KIND;

    typedef enum
    {
        EATEN, DEAD, ALIVE
    } LIFE; // or int LIFE

//    typedef enum
//    {
//        EATEN, DEAD, ALIVE
//    };
//    int LIFE;

    typedef struct
    {
        int onec;			// one character
        int attr;			// its color
    } ASOG;				// A Square On the Ground

    typedef enum
    {
        NORTH, NORTHEAST, EAST, SE, S, SW, W, NW
    } DIRECTION;

    typedef struct
    {
        int color;
        int capacity;			// stomach size
        int foodValue;
    } WORM_INFO;

    typedef struct
    {
        int x, y;			// coordinates of the segment
        char c;			// the letter it carries
    } SEGMENT;

    worm();
    worm(WORM_KIND nkind);
    virtual ~worm();

    int getStatus();
    int getInfoColor();
    int getInfoCapacity();
    int getInfoFoodVal();
    int getDirection();
    int getChar();
    int getCharColour();

    void setStatus(LIFE);
    int setInfoColor();
    int setInfoCapacity();
    int setInfoFoodVal();
    int setDirection();
    int setChar();
    int setCharColour();
    void setType(WORM_KIND);

private:
    const char * say[]; // worms carry these strings

    //WORM_KIND type;		// once set, type does not change
    int direction;		// its (head's) direction
    int nsegs;			// # of segs in this worm
    int stomach;			// food value

    LIFE status;			// EATEN, DEAD, or ALIVE

    SEGMENT seg[];	    // body parts

    WORM_INFO info;

    WORM_KIND kind;

    DIRECTION dir;

    ASOG square;
};

#endif // WORM_H
